<template>
  <div>
    <van-nav-bar title="被采纳的建议" left-arrow @click-left="onClickLeft">
      <template #left>
        <van-icon name="arrow-left" style="color: #000; font-size: 24px" />
      </template>
    </van-nav-bar>
    <div class="wrap" v-for="(item, index) in dataList" :key="index" style="border-bottom: .2rem solid rgb(242, 242, 242);width: 100%;">
      <div class="shang" style="width: 80%;margin-left: 10%;">
        <div class="user">
          <div>
            <img :src=item.releaseUserHeadPic alt="" style="width: 1.3rem; height: 1.3rem; border-radius: 50%" />
            <p class="yes">{{ item.releaseUserNickName }}</p>
          </div>
        </div>
        <div class="title">
          <p style="margin-top: .2rem;font-size: .4rem">{{ item.title }}</p>
          <b style="font-size: .4rem">主要病症：{{ item.disease }}</b>
             <p style="margin-top: .2rem; line-height: .2rem;font-size: .35rem">采纳时间：{{ item.adoptTime }}</p>

        </div>
      </div>
      <hr />
      <div class="xia">
        <h4 style="line-height: 1.2rem;">我的建议</h4>
        <p style="font-size: .42rem;margin-bottom: .3rem;color: #b0acac;">{{ item.content }}</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { findMyAdoptedCommentList } from '../../api/search'
import { ref } from 'vue'
const dataList: any = ref({})
const userId = ref(JSON.parse(localStorage.getItem('userId') as string))
const sessionId = ref(JSON.parse(localStorage.getItem('sessionId') as string))
const onClickLeft = () => {
  history.back()
}
const findMyAdoptedCommentList1 = async () => {
  const res = await findMyAdoptedCommentList(userId.value, sessionId.value, {
    page: 1,
    count: 30
  })
  console.log(res.data.result)
  dataList.value = res.data.result
}
findMyAdoptedCommentList1()
</script>
<style scoped>
@import './suggestion.scss';
.shang{
    height: 3rem;
}
img{
    margin-top: .3rem;

    text-align: center;
}
.yes{
    text-align: center;
}
</style>
